Skip to content

Include 5xx responses in default HTTP client error statuses#11156

Closed
saravadeo wants to merge 2 commits intoDataDog:masterfrom
saravadeo:fix/http-client-error-statuses-5xx
Closed

Include 5xx responses in default HTTP client error statuses#11156
saravadeo wants to merge 2 commits intoDataDog:masterfrom
saravadeo:fix/http-client-error-statuses-5xx

Conversation

@saravadeo
Copy link
Copy Markdown
Contributor

@saravadeo saravadeo commented Apr 18, 2026

Fixes #10245

Default DEFAULT_HTTP_CLIENT_ERROR_STATUSES now includes HTTP 5xx so outbound client spans and downstream metrics treat server errors as span errors unless overridden via DD_TRACE_HTTP_CLIENT_ERROR_STATUSES / DD_HTTP_CLIENT_ERROR_STATUSES.

@saravadeo saravadeo force-pushed the fix/http-client-error-statuses-5xx branch from 937c00a to 2206ee2 Compare April 18, 2026 04:21
Default client error range was 4xx only, so downstream HTTP spans did not
mark 5xx responses as errors. Align defaults with server-side semantics by
treating 500-599 as errors unless overridden.

Fixes DataDog#10245
@saravadeo saravadeo force-pushed the fix/http-client-error-statuses-5xx branch from 2206ee2 to 876a5a1 Compare April 18, 2026 04:22
@saravadeo
Copy link
Copy Markdown
Contributor Author

I don’t have permission to add labels on this repo. Could a maintainer please add the appropriate comp: / inst: and type: labels per CONTRIBUTING (this change is user-facing default behavior for HTTP client error statuses). Thanks!

@saravadeo saravadeo marked this pull request as ready for review April 21, 2026 06:49
@saravadeo saravadeo requested review from a team as code owners April 21, 2026 06:49
@saravadeo saravadeo requested review from amarziali and removed request for a team April 21, 2026 06:49
@amarziali
Copy link
Copy Markdown
Contributor

👋 @saravadeo thanks for having opened this PR. Unfortunately this default cannot be changed so simply since will result in a breaking change for other customers. The custom behaviour should be done via configuration.

@saravadeo
Copy link
Copy Markdown
Contributor Author

Hey @amarziali 👋

Thanks for the clarification — makes sense that changing the default would be a breaking change.

In that case, I’ve updated the issue thread to let the issue owner know that this needs to be handled via configuration on their side, and I’m closing this PR.

@saravadeo
Copy link
Copy Markdown
Contributor Author

Closing per maintainer review: default cannot be changed without a breaking change; use DD_TRACE_HTTP_CLIENT_ERROR_STATUSES / DD_HTTP_CLIENT_ERROR_STATUSES for custom behavior. Thanks again.

@saravadeo saravadeo closed this Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update DEFAULT_HTTP_CLIENT_ERROR_STATUSES to include 5xx status codes

2 participants